package com.kuaihuoyun.ctms.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import retrofit2.Response;

import java.io.Serializable;

/**
 * Created by lxji on 2018/1/3.
 */
@Data
@NoArgsConstructor
public class CtmsResponse<T> implements Serializable {
    private int code;

    private String message;

    private T data;

    public static CtmsResponse create(Response response) {
        CtmsResponse resp = new CtmsResponse();
        resp.setCode(response.code());
        resp.setMessage(response.message());
        return resp;
    }
}
